package ryarithsGame;

import com.jme.math.Vector2f;
import com.jme.math.Vector3f;
import com.jme.scene.Node;

public class Level2 extends Node 
{

	private PuzzleNode[] puzzle;
	private Goal goal;
	private static final long serialVersionUID = 1L;

	public Level2()
	{
		super("Level2");
		loadPuzzle();
	}
	
	private void loadPuzzle()
	{
		goal = new Goal("goal", new Vector3f(50,15,312.5f));
		puzzle = new PuzzleNode[1];
		puzzle[0] = new PuzzleNode("switch1", 1, new Vector3f(312.5f,10,500),new Vector3f(312.5f,10,312.5f));
		this.attachChild(goal);
		this.attachChild(puzzle[0]);
	}
	
	public void updateLevel(float tpf)
	{
		puzzle[0].updatePuzzleNode(tpf);
		goal.updateGoalNode();	
	}
	
	public void checkSwitchCollisions(Vector2f camPos)
	{
		goal.checkSwitchCollisions(camPos);
	}
	
	public boolean getGoalSwitch()
	{
		return goal.getIsSwitched();
	}
	
	public PuzzleNode getPuzzleNode(int i)
	{
		return puzzle[i];
	}
	
	public int puzzleSize()
	{
		return puzzle.length;
	}
	
}
